package com.zang.blogz.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author 朵橙i
 * @since 2022-06-17
 */
@Getter
@Setter
@TableName("tb_article")
@ApiModel(value = "Article对象", description = "")
@NoArgsConstructor
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("作者")
    @TableField("user_id")
    private Integer userId;

    @ApiModelProperty("文章分类")
    @TableField("category_id")
    private Integer categoryId;

    @ApiModelProperty("文章缩略图")
    @TableField("article_cover")
    private String articleCover;

    @ApiModelProperty("标题")
    @TableField("article_title")
    private String articleTitle;

    @ApiModelProperty("内容")
    @TableField("article_content")
    private String articleContent;

    @ApiModelProperty("文章类型 1原创 2转载 3翻译")
    @TableField("type")
    private Integer type;

    @ApiModelProperty("原文链接")
    @TableField("original_url")
    private String originalUrl;

    @ApiModelProperty("是否置顶 0否 1是")
    @TableField("is_top")
    private Integer isTop;

    @ApiModelProperty("是否删除  0否 1是")
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;

    @ApiModelProperty("状态值 1公开 2私密 3评论可见")
    @TableField("status")
    private Integer status;

    @ApiModelProperty("发表时间")
    @TableField(value = "create_time" ,fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time",fill = FieldFill.UPDATE)
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date updateTime;




}
